<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:s="http://jboss.org/seam/faces"
	xmlns:p="http://primefaces.org/ui" template="/_template.xhtml">
	<f:metadata>
	<f:viewParam name="id" value="#{historicoDetalhadoBean.historicoId}"></f:viewParam>
	</f:metadata>

	<ui:define name="corpo">
	
	  <h:form>
			<h2>Historico da Geracao</h2>
			<h:dataTable value="#{historicoDetalhadoBean.historicos}" var="historico"
				styleClass="dados" rowClasses="impar,par">

		<h:column>
					<f:facet name="header">ID</f:facet>
			#{historico.id}
		</h:column>
		<h:column>
		<f:facet name="header">Cliente</f:facet>
			#{historico.ambiente.cliente.sigla}
		</h:column>

		<h:column>
					<f:facet name="header">Intervalo Revisao: </f:facet>
			#{historico.revisaoInicial} -  #{historico.revisaoFinal}
		</h:column>  
  	<h:column>   
   					<f:facet name="header">Download</f:facet>   
  		<p:commandButton id="dados" value="Dados" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop)"  icon="ui-icon-arrowthichk-s">  
    		<p:fileDownload value="#{historicoDetalhadoBean.fileDados}" />  
		</p:commandButton>  
		<p:commandButton id="estrutura" value="Estrutura" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop)"  icon="ui-icon-arrowthichk-s">  
    		<p:fileDownload value="#{historicoDetalhadoBean.fileEstrutura}" />  
		</p:commandButton>   
  	</h:column>
  	
  		<h:column>
  			<f:facet name="header">Autor</f:facet>
  			#{historico.usuario.nome}
  	</h:column>   
  	  		<h:column>
  			<f:facet name="header">Chamado</f:facet>
  			#{historico.nrChamado}
  	</h:column>   
			</h:dataTable>
		</h:form>
					  <h:form>
			<h2>Ambiente</h2>
			<h:dataTable value="#{historicoDetalhadoBean.ambientes}" var="ambiente"
				styleClass="dados" rowClasses="impar,par">

		<h:column>
					<f:facet name="header">ID</f:facet>
			#{ambiente.id}
		</h:column>
		<h:column>
		<f:facet name="header">Tipo</f:facet>
			#{ambiente.tpAmbiente} - #{ambiente.tipoAmbienteCliente.tipo}
		</h:column>
		<h:column>
		<f:facet name="header">URL</f:facet>
			#{ambiente.branch.url}
		</h:column>
		<h:column>
			<f:facet name="header">Nome</f:facet>
				#{ambiente.branch.nome}
		</h:column>
			</h:dataTable>
		</h:form>
			  <h:form>
			<h2>Arquivos ultilizados</h2>
			<h:dataTable value="#{historicoDetalhadoBean.historico.arquivos}" var="arquivo"
				styleClass="dados" rowClasses="impar,par">

		<h:column>
					<f:facet name="header">ID</f:facet>
			#{arquivo.id}
		</h:column>
		<h:column>
		<f:facet name="header">Arquivo</f:facet>
			#{arquivo.nome}
		</h:column>
			</h:dataTable>
		</h:form>

	</ui:define>
</ui:composition>